<template>

  <el-dialog title="查看库存" v-model="dialogVisible" @close='dialogFormVisible' :close-on-click-modal="false"
    :close-on-press-escape="false" width="600px">
	  <el-table size="small" :data="list" border style="width: 100%" >
		    <el-table-column prop="product_name" label="名称" width="300"></el-table-column>
			<el-table-column prop="num" label="库存" width="300"></el-table-column>
	   </el-table>
    <template #footer> 
        <div class="dialog-footer">
            <el-button @click="dialogFormVisible">返回</el-button>

        </div>
    </template>
  </el-dialog>
</template>

<script>
import StoreApi from '@/api/store.js';
  export default {
    data() {
      return {
        /*左边长度*/
        formLabelWidth: '120px',
        /*是否显示*/
        dialogVisible: false,
        /*是否正在提交*/
        submit_loading: false,
		list:[],
		loading:true,
      };
    },
    props: ['open_edit', 'form'],
    created() {
      this.dialogVisible = this.open_edit;
	  this.editGrade();
    },
    methods: {
      /*修改用户*/
      editGrade() {
        let self = this;
        let params = this.form;
		StoreApi.viewkc({
		    user_id: params.user_id
		  }, true)
		  .then(data => {
			console.log(data);
			self.list = data.data.list;
			self.loading = false;
		  })
		  .catch(error => {
		   
		  });
      },

      /*关闭弹窗*/
      dialogFormVisible(e) {
        if (e) {
          this.$emit('closeDialog', {
            type: 'success',
            openDialog: false
          })
        } else {
          this.$emit('closeDialog', {
            type: 'error',
            openDialog: false
          })
        }
      }

    }
  };
</script>

<style></style>
